﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace House_World
{
    class Models3D : Transform
    {

        private BasicEffect effect;
        private Model model;

        public Models3D(Model model,GraphicsDevice graphicsDevice)
        {
            this.model = model;
          
        }

        public void Draw(Camera camera)
        {
            foreach (ModelMesh mesh in model.Meshes)
            {
                foreach (BasicEffect effectModel in mesh.Effects)
                {
                    effectModel.EnableDefaultLighting();
                    effectModel.Projection = camera.Projector;
                    effectModel.View = camera.View;
                    effectModel.World = (Matrix.Identity * mesh.ParentBone.Transform);
                    effectModel.World *= Matrix.CreateTranslation(new Vector3(20, 15, -15));
                }
                mesh.Draw();
            }

        }
    }
}
